<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a class="btn btn-info" href="https://api.weibo.com/oauth2/authorize?client_id=1993131433&response_type=code&redirect_uri=http://api.jianlou.shop/index.php/apis/login/weibo_notice">微博登录</a>
</body>
<script src='https://cdn.bootcss.com/socket.io/2.0.3/socket.io.js'></script>
<script>
    // 如果服务端不在本机，请把127.0.0.1改成服务端ip
    var socket = io('http://182.61.58.222:2120');
    // 当连接服务端成功时触发connect默认事件
    socket.on('connect', function(){
        socket.emit('login',"11111111");
    });
    // 后端推送来消息时
    socket.on('new_msg', function(msg){
      console.log(msg);
      //   alert('收到消息：'+msg);
    })
</script>
</html>